#include "LeBSTExt.h"

struct Comparer // works like std::greater<int>
{
	bool operator()(int one, int two) const { return one > two; }
};

int main()
{
	//LeBST<int> tree;
	LeBST<int, Comparer> tree;
	
	int temp = 0;
	temp = tree.find(10);
	temp = tree.insert(10);
	temp = tree.insert(14);
	temp = tree.insert(16);
	temp = tree.insert(6);
	temp = tree.insert(8);
	temp = tree.insert(2);
	temp = tree.insert(0);
	temp = tree.insert(-1);
	temp = tree.insert(1);
	temp = tree.insert(4);
	temp = tree.insert(3);
	temp = tree.insert(5);
	
	temp = tree.min();
	temp = tree.max();
	temp = tree.find(10);

	temp = tree.erase(14); // only right child
	temp = tree.erase(16); // no children
	temp = tree.erase(10); // only left child, erasing root
	temp = tree.erase(2); // has both children

	system("pause");
	return 0;
}